Rules for integrands of the form(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p) whenq>1

1:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when PolynomialRemainder[(Subscript[P, q])[x],d+e x,x]==0

Derivation: Algebraic simplification

Rule 1.2.1.9.1: If  PolynomialRemainder[(Subscript[P, q])[x],d+e x,x]==0, then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ∫(((d+e x))^(m+1)) PolynomialQuotient[(Subscript[P, q])[x],d+e x,x] (((a+b x+c (x^2)))^p)dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[(d+e*x)^(m+1)*PolynomialQuotient[Pq,d+e*x,x]*(a+b*x+c*x^2)^p,x] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[PolynomialRemainder[Pq,d+e*x,x],0]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[(d+e*x)^(m+1)*PolynomialQuotient[Pq,d+e*x,x]*(a+c*x^2)^p,x] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[PolynomialRemainder[Pq,d+e*x,x],0]

2:  ∫(((d+e x))^m) (((a+b x+c (x^2)))^p) (f+g x+h (x^2))dx  
		when  b e h (m+p+2)+2 c d h (p+1)-c e g (m+2 p+3)==0 ∧ b d h (p+1)+a e h (m+1)-c e f (m+2 p+3)==0 ∧ m+2 p+3≠0

Derivation: Special case of one step of the Ostrogradskiy-Hermite integration method

Rule 1.2.1.9.2: If  b e h (m+p+2)+2 c d h (p+1)-c e g (m+2 p+3)==0 ∧ b d h (p+1)+a e h (m+1)-c e f (m+2 p+3)==0 ∧ m+2 p+3≠0, then

∫(((d+e x))^m) (((a+b x+c (x^2)))^p) (f+g x+h (x^2))dx  ⟶  ((h (((d+e x))^(m+1)) (((a+b x+c (x^2)))^(p+1)))/(c e (m+2 p+3)))

Program code:

Int[(d_.+e_.*x_)^m_.*P2_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  With[{f=Coeff[P2,x,0],g=Coeff[P2,x,1],h=Coeff[P2,x,2]},
  h*(d+e*x)^(m+1)*(a+b*x+c*x^2)^(p+1)/(c*e*(m+2*p+3)) /;
 EqQ[b*e*h*(m+p+2)+2*c*d*h*(p+1)-c*e*g*(m+2*p+3),0] && EqQ[b*d*h*(p+1)+a*e*h*(m+1)-c*e*f*(m+2*p+3),0]] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[P2,x,2] && NeQ[m+2*p+3,0]

Int[(d_+e_.*x_)^m_.*P2_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  With[{f=Coeff[P2,x,0],g=Coeff[P2,x,1],h=Coeff[P2,x,2]},
  h*(d+e*x)^(m+1)*(a+c*x^2)^(p+1)/(c*e*(m+2*p+3)) /;
 EqQ[2*d*h*(p+1)-e*g*(m+2*p+3),0] && EqQ[a*h*(m+1)-c*f*(m+2*p+3),0]] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[P2,x,2] && NeQ[m+2*p+3,0]

3:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when p+2∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule 1.2.1.9.3: If  p+2∈(SuperPlus[ℤ]), then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ∫ ExpandIntegrand[(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p),x]dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[ExpandIntegrand[(d+e*x)^m*Pq*(a+b*x+c*x^2)^p,x],x] /;
FreeQ[{a,b,c,d,e,m},x] && PolyQ[Pq,x] && IGtQ[p,-2]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[ExpandIntegrand[(d+e*x)^m*Pq*(a+c*x^2)^p,x],x] /;
FreeQ[{a,c,d,e,m},x] && PolyQ[Pq,x] && IGtQ[p,-2]

4:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c==0

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)((((a+b x+c (x^2)))^p)/(((b+2 c x))^(2 p)))==0

Rule 1.2.1.9.4: If  (b^2)-4 a c==0, then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ((((a+b x+c (x^2)))^(FracPart[p]))/((((4 c))^(IntPart[p])) (((b+2 c x))^(2 FracPart[p]))))∫(((d+e x))^m) (Subscript[P, q])[x](((b+2 c (x^2)))^(2 p))dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (a+b*x+c*x^2)^FracPart[p]/((4*c)^IntPart[p]*(b+2*c*x)^(2*FracPart[p]))*Int[(d+e*x)^m*Pq*(b+2*c*x)^(2*p),x] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[b^2-4*a*c,0]

5.  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0

1:  ∫(((e x))^m) (Subscript[P, q])[x] (((b x+c (x^2)))^p)dx  when PolynomialRemainder[(Subscript[P, q])[x],b+c x,x]==0

Derivation: Algebraic simplification

Basis: (Subscript[P, q])[x]==(1/(e x))((e (Subscript[P, q])[x])/(b+c x)) (b x+c (x^2))

Rule 1.2.1.9.5.1: If  PolynomialRemainder[(Subscript[P, q])[x],b+c x,x]==0, then

∫(((e x))^m) (Subscript[P, q])[x] (((b x+c (x^2)))^p)dx  ⟶  e ∫(((e x))^(m-1)) PolynomialQuotient[(Subscript[P, q])[x],b+c x,x] (((b x+c (x^2)))^(p+1)) dx

Program code:

Int[(e_.*x_)^m_.*Pq_*(b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  e*Int[(e*x)^(m-1)*PolynomialQuotient[Pq,b+c*x,x]*(b*x+c*x^2)^(p+1),x] /;
FreeQ[{b,c,e,m,p},x] && PolyQ[Pq,x] && EqQ[PolynomialRemainder[Pq,b+c*x,x],0]

2:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ PolynomialRemainder[(Subscript[P, q])[x],a e+c d x,x]==0

Derivation: Algebraic simplification

Basis: If  c (d^2)-b d e+a (e^2)==0, then (d+e x) (a e+c d x)==d e (a+b x+c (x^2))

Rule 1.2.1.9.5.2: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ PolynomialRemainder[(Subscript[P, q])[x],a e+c d x,x]==0,
    let (Subscript[Q, q-1])[x]->PolynomialQuotient[(Subscript[P, q])[x],a e+c d x,x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  d e ∫(((d+e x))^(m-1)) (Subscript[Q, q-1])[x] (((a+b x+c (x^2)))^(p+1)) dx

Program code:

Int[(d_+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  d*e*Int[(d+e*x)^(m-1)*PolynomialQuotient[Pq,a*e+c*d*x,x]*(a+b*x+c*x^2)^(p+1),x] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0] && EqQ[PolynomialRemainder[Pq,a*e+c*d*x,x],0]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  d*e*Int[(d+e*x)^(m-1)*PolynomialQuotient[Pq,a*e+c*d*x,x]*(a+c*x^2)^(p+1),x] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && EqQ[PolynomialRemainder[Pq,a*e+c*d*x,x],0]

3:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p+(1/2)∈(SuperMinus[ℤ])∧ m>0

Derivation: Algebraic expansion and special quadratic recurrence 2b

Basis: If  c (d^2)-b d e+a (e^2)==0, then (d+e x) (a e+c d x)==d e (a+b x+c (x^2))

Rule 1.2.1.9.5.3: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p+(1/2)∈(SuperMinus[ℤ])∧ m>0, 
    let (Subscript[Q, q-1])[x]->PolynomialQuotient[(Subscript[P, q])[x],a e+c d x,x] and f->PolynomialRemainder[(Subscript[P, q])[x],a e+c d x,x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

f ∫(((d+e x))^m) (((a+b x+c (x^2)))^p)dx+d e ∫(((d+e x))^(m-1)) (Subscript[Q, q-1])[x] (((a+b x+c (x^2)))^(p+1))dx  ⟶  

((f (2 c d-b e) (((d+e x))^m) (((a+b x+c (x^2)))^(p+1)))/(e(p+1)((b^2)-4 a c) ))+
(1/((p+1) ((b^2)-4 a c))) ∫(((d+e x))^(m-1)) (((a+b x+c (x^2)))^(p+1))(d e (p+1) ((b^2)-4 a c) (Subscript[Q, q-1])[x]-f (2 c d-b e) (m+2 p+2)) dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a*e+c*d*x,x], f=PolynomialRemainder[Pq,a*e+c*d*x,x]},
  f*(2*c*d-b*e)*(d+e*x)^m*(a+b*x+c*x^2)^(p+1)/(e*(p+1)*(b^2-4*a*c)) + 
  1/((p+1)*(b^2-4*a*c))*Int[(d+e*x)^(m-1)*(a+b*x+c*x^2)^(p+1)*
    ExpandToSum[d*e*(p+1)*(b^2-4*a*c)*Q-f*(2*c*d-b*e)*(m+2*p+2),x],x]] /;
FreeQ[{a,b,c,d,e},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0] && ILtQ[p+1/2,0] && GtQ[m,0]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a*e+c*d*x,x], f=PolynomialRemainder[Pq,a*e+c*d*x,x]},
  -d*f*(d+e*x)^m*(a+c*x^2)^(p+1)/(2*a*e*(p+1)) + 
  d/(2*a*(p+1))*Int[(d+e*x)^(m-1)*(a+c*x^2)^(p+1)*ExpandToSum[2*a*e*(p+1)*Q+f*(m+2*p+2),x],x]] /;
FreeQ[{a,c,d,e},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && ILtQ[p+1/2,0] && GtQ[m,0]

4:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ m+q+2 p+1==0 ∧ m∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Rule 1.2.1.9.5.4: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ m+q+2 p+1==0 ∧ m∈(SuperMinus[ℤ]), then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ∫(((a+b x+c (x^2)))^p) ExpandIntegrand[(((d+e x))^m) (Subscript[P, q])[x],x]dx

Program code:

Int[(d_.+e_.*x_)^m_*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  Int[ExpandIntegrand[(a+b*x+c*x^2)^p,(d+e*x)^m*Pq,x],x] /;
FreeQ[{a,b,c,d,e},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0] && EqQ[m+Expon[Pq,x]+2*p+1,0] && ILtQ[m,0]

Int[(d_+e_.*x_)^m_*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  Int[ExpandIntegrand[(a+c*x^2)^p,(d+e*x)^m*Pq,x],x] /;
FreeQ[{a,c,d,e},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && EqQ[m+Expon[Pq,x]+2*p+1,0] && ILtQ[m,0]

5:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ m+q+2 p+1≠0

Derivation: Algebraic expansion and quadratic recurrence 3a with A=d, B=e and m=m-1

Rule 1.2.1.9.5.5: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ m+q+2 p+1≠0, let f->(Subscript[P, q])[x,q], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(((d+e x))^m) ((Subscript[P, q])[x]-(f/(e^q)) (((d+e x))^q)) (((a+b x+c (x^2)))^p)dx+(f/(e^q)) ∫(((d+e x))^(m+q)) (((a+b x+c (x^2)))^p)dx  ⟶  

((f (((d+e x))^(m+q-1)) (((a+b x+c (x^2)))^(p+1)))/(c (e^(q-1)) (m+q+2 p+1)))+(1/(c (e^q) (m+q+2 p+1))) ∫(((d+e x))^m) (((a+b x+c (x^2)))^p)·
(c (e^q) (m+q+2 p+1) (Subscript[P, q])[x]-c f (m+q+2 p+1) (((d+e x))^q)+e f (m+p+q) (((d+e x))^(q-2)) (b d-2 a e+(2 c d-b e) x))dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x],f=Coeff[Pq,x,Expon[Pq,x]]},
  f*(d+e*x)^(m+q-1)*(a+b*x+c*x^2)^(p+1)/(c*e^(q-1)*(m+q+2*p+1)) + 
  1/(c*e^q*(m+q+2*p+1))*Int[(d+e*x)^m*(a+b*x+c*x^2)^p*
    ExpandToSum[c*e^q*(m+q+2*p+1)*Pq-c*f*(m+q+2*p+1)*(d+e*x)^q+e*f*(m+p+q)*(d+e*x)^(q-2)*(b*d-2*a*e+(2*c*d-b*e)*x),x],x] /;
 NeQ[m+q+2*p+1,0]] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x],f=Coeff[Pq,x,Expon[Pq,x]]},
  f*(d+e*x)^(m+q-1)*(a+c*x^2)^(p+1)/(c*e^(q-1)*(m+q+2*p+1)) + 
  1/(c*e^q*(m+q+2*p+1))*Int[(d+e*x)^m*(a+c*x^2)^p*
    ExpandToSum[c*e^q*(m+q+2*p+1)*Pq-c*f*(m+q+2*p+1)*(d+e*x)^q-2*e*f*(m+p+q)*(d+e*x)^(q-2)*(a*e-c*d*x),x],x] /;
 NeQ[m+q+2*p+1,0]] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && Not[IGtQ[m,0]]

6:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p∈ℤ

Derivation: Algebraic simplification

Basis: If  c (d^2)-b d e+a (e^2)==0, then a+b x+c (x^2)==(d+e x) ((a/d)+((c x)/e))

Rule 1.2.1.9.5.6: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p∈ℤ, then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ∫(((d+e x))^(m+p)) ((((a/d)+((c x)/e)))^p)(Subscript[P, q])[x] dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[(d+e*x)^(m+p)*(a/d+c/e*x)^p*Pq,x] /;
FreeQ[{a,b,c,d,e,m},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0] && IntegerQ[p]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  Int[(d+e*x)^(m+p)*(a/d+c/e*x)^p*Pq,x] /;
FreeQ[{a,c,d,e,m},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && IntegerQ[p]

7:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis: If  c (d^2)-b d e+a (e^2)==0, then (∂_x)((((a+b x+c (x^2)))^p)/((((d+e x))^p) ((((a/d)+((c x)/e)))^p)))==0

Rule 1.2.1.9.5.7: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)==0 ∧ p∉ℤ, then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  ((((a+b x+c (x^2)))^(FracPart[p]))/((((d+e x))^(FracPart[p])) ((((a/d)+((c x)/e)))^(FracPart[p]))))∫(((d+e x))^(m+p)) ((((a/d)+((c x)/e)))^p) (Subscript[P, q])[x]dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  (a+b*x+c*x^2)^FracPart[p]/((d+e*x)^FracPart[p]*(a/d+(c*x)/e)^FracPart[p])*Int[(d+e*x)^(m+p)*(a/d+c/e*x)^p*Pq,x] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && EqQ[c*d^2-b*d*e+a*e^2,0] && Not[IntegerQ[p]] && Not[IGtQ[m,0]]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  (a+c*x^2)^FracPart[p]/((d+e*x)^FracPart[p]*(a/d+(c*x)/e)^FracPart[p])*Int[(d+e*x)^(m+p)*(a/d+c/e*x)^p*Pq,x] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && EqQ[c*d^2+a*e^2,0] && Not[IntegerQ[p]] && Not[IGtQ[m,0]]

6.  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1

1:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m>0

Derivation: Algebraic expansion and quadratic recurrence 2a

Rule 1.2.1.9.6.1: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m>0, 
    let (Subscript[Q, q-2])[x]->PolynomialQuotient[(Subscript[P, q])[x],a+b x+c (x^2),x] and f+g x->PolynomialRemainder[(Subscript[P, q])[x],a+b x+c (x^2),x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(((d+e x))^m) (f+g x) (((a+b x+c (x^2)))^p)dx+∫(((d+e x))^(m-1)) (d+e x) (Subscript[Q, q-2])[x] (((a+b x+c (x^2)))^(p+1))dx  ⟶  

(((((d+e x))^m) (((a+b x+c (x^2)))^(p+1)) (f b-2 a g+(2 c f-b g) x))/((p+1) ((b^2)-4 a c)))+
(1/((p+1) ((b^2)-4 a c))) ∫(((d+e x))^(m-1)) (((a+b x+c (x^2)))^(p+1))·
((p+1) ((b^2)-4 a c) (d+e x) (Subscript[Q, q-2])[x]+g (2 a e m+b d (2 p+3))-f (b e m+2 c d (2 p+3))-e(2 c f-b g) (m+2 p+3) x) dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a+b*x+c*x^2,x],
        f=Coeff[PolynomialRemainder[Pq,a+b*x+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[Pq,a+b*x+c*x^2,x],x,1]},
  (d+e*x)^m*(a+b*x+c*x^2)^(p+1)*(f*b-2*a*g+(2*c*f-b*g)*x)/((p+1)*(b^2-4*a*c)) + 
  1/((p+1)*(b^2-4*a*c))*Int[(d+e*x)^(m-1)*(a+b*x+c*x^2)^(p+1)*
    ExpandToSum[(p+1)*(b^2-4*a*c)*(d+e*x)*Q+g*(2*a*e*m+b*d*(2*p+3))-f*(b*e*m+2*c*d*(2*p+3))-e*(2*c*f-b*g)*(m+2*p+3)*x,x],x]] /;
FreeQ[{a,b,c,d,e},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && LtQ[p,-1] && GtQ[m,0] && 
  (IntegerQ[p] || Not[IntegerQ[m]] || Not[RationalQ[a,b,c,d,e]]) && 
  Not[IGtQ[m,0] && RationalQ[a,b,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a+c*x^2,x],
        f=Coeff[PolynomialRemainder[Pq,a+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[Pq,a+c*x^2,x],x,1]},
  (d+e*x)^m*(a+c*x^2)^(p+1)*(a*g-c*f*x)/(2*a*c*(p+1)) + 
  1/(2*a*c*(p+1))*Int[(d+e*x)^(m-1)*(a+c*x^2)^(p+1)*
    ExpandToSum[2*a*c*(p+1)*(d+e*x)*Q-a*e*g*m+c*d*f*(2*p+3)+c*e*f*(m+2*p+3)*x,x],x]] /;
FreeQ[{a,c,d,e},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && LtQ[p,-1] && GtQ[m,0] && 
  Not[IGtQ[m,0] && RationalQ[a,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

2.  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m≯0

1:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m∈(SuperMinus[ℤ])

Derivation: Algebraic expansion and trinomial recurrence 2b

Rule 1.2.1.9.6.2.1: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m∈(SuperMinus[ℤ]), 
    let (Subscript[Q, m+q-2])[x]->PolynomialQuotient[(((d+e x))^m) (Subscript[P, q])[x],a+b x+c (x^2),x]and f+g x->PolynomialRemainder[(((d+e x))^m) (Subscript[P, q])[x],a+b x+c (x^2),x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(f+g x) (((a+b x+c (x^2)))^p)dx+∫(Subscript[Q, m+q-2])[x] (((a+b x+c (x^2)))^(p+1))dx  ⟶  

(( (b f-2 a g+(2 c f-b g) x)(((a+b x+c (x^2)))^(p+1)))/((p+1) ((b^2)-4 a c)))+
(1/((p+1) ((b^2)-4 a c)))∫(((d+e x))^m) (((a+b x+c (x^2)))^(p+1))((p+1) ((b^2)-4 a c) (((d+e x))^(-m)) (Subscript[Q, m+q-2])[x]-(2 p+3) (2 c f-b g) (((d+e x))^(-m))) dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[(d+e*x)^m*Pq,a+b*x+c*x^2,x],
        f=Coeff[PolynomialRemainder[(d+e*x)^m*Pq,a+b*x+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[(d+e*x)^m*Pq,a+b*x+c*x^2,x],x,1]},
  (b*f-2*a*g+(2*c*f-b*g)*x)*(a+b*x+c*x^2)^(p+1)/((p+1)*(b^2-4*a*c)) + 
  1/((p+1)*(b^2-4*a*c))*Int[(d+e*x)^m*(a+b*x+c*x^2)^(p+1)*
    ExpandToSum[(p+1)*(b^2-4*a*c)*(d+e*x)^(-m)*Q-(2*p+3)*(2*c*f-b*g)*(d+e*x)^(-m),x],x]] /;
FreeQ[{a,b,c,d,e},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && LtQ[p,-1] && ILtQ[m,0]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[(d+e*x)^m*Pq,a+c*x^2,x],
        f=Coeff[PolynomialRemainder[(d+e*x)^m*Pq,a+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[(d+e*x)^m*Pq,a+c*x^2,x],x,1]},
  (a*g-c*f*x)*(a+c*x^2)^(p+1)/(2*a*c*(p+1)) + 
  1/(2*a*c*(p+1))*Int[(d+e*x)^m*(a+c*x^2)^(p+1)*
    ExpandToSum[2*a*c*(p+1)*(d+e*x)^(-m)*Q+c*f*(2*p+3)*(d+e*x)^(-m),x],x]] /;
FreeQ[{a,c,d,e},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && LtQ[p,-1] && ILtQ[m,0]

2:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m≯0

Derivation: Algebraic expansion and quadratic recurrence 2b

Rule 1.2.1.9.6.2.2: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ p<-1 ∧ m≯0, 
    let (Subscript[Q, q-2])[x]->PolynomialQuotient[(Subscript[P, q])[x],a+b x+c (x^2),x] and f+g x->PolynomialRemainder[(Subscript[P, q])[x],a+b x+c (x^2),x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(((d+e x))^m) (f+g x) (((a+b x+c (x^2)))^p)dx+∫(((d+e x))^m) (Subscript[Q, q-2])[x] (((a+b x+c (x^2)))^(p+1))dx  ⟶  

(((((d+e x))^(m+1)) (((a+b x+c (x^2)))^(p+1)) (f (b c d-(b^2) e+2 a c e)-a g (2 c d-b e)+c (f (2 c d-b e)-g (b d-2 a e)) x))/((p+1)((b^2)-4 a c) (c (d^2)-b d e+a (e^2))))+
(1/((p+1) ((b^2)-4 a c) (c (d^2)-b d e+a (e^2)))) ∫(((d+e x))^m) (((a+b x+c (x^2)))^(p+1))·
((p+1) ((b^2)-4 a c) (c (d^2)-b d e+a (e^2)) (Subscript[Q, q-2])[x]+
f (b c d e (2 p-m+2)+(b^2) (e^2) (p+m+2)-2 (c^2) (d^2) (2 p+3)-2 a c (e^2) (m+2 p+3))-
g (a e (b e-2 c d m+b e m)-b d (3 c d-b e+2 c d p-b e p))+
c e(g (b d-2 a e)-f (2 c d-b e)) (m+2p+4) x) dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a+b*x+c*x^2,x],
        f=Coeff[PolynomialRemainder[Pq,a+b*x+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[Pq,a+b*x+c*x^2,x],x,1]},
  (d+e*x)^(m+1)*(a+b*x+c*x^2)^(p+1)*(f*(b*c*d-b^2*e+2*a*c*e)-a*g*(2*c*d-b*e)+c*(f*(2*c*d-b*e)-g*(b*d-2*a*e))*x)/
    ((p+1)*(b^2-4*a*c)*(c*d^2-b*d*e+a*e^2)) + 
  1/((p+1)*(b^2-4*a*c)*(c*d^2-b*d*e+a*e^2))*Int[(d+e*x)^m*(a+b*x+c*x^2)^(p+1)*
   ExpandToSum[(p+1)*(b^2-4*a*c)*(c*d^2-b*d*e+a*e^2)*Q+
      f*(b*c*d*e*(2*p-m+2)+b^2*e^2*(p+m+2)-2*c^2*d^2*(2*p+3)-2*a*c*e^2*(m+2*p+3))-
      g*(a*e*(b*e-2*c*d*m+b*e*m)-b*d*(3*c*d-b*e+2*c*d*p-b*e*p))+
      c*e*(g*(b*d-2*a*e)-f*(2*c*d-b*e))*(m+2*p+4)*x,x],x]] /;
FreeQ[{a,b,c,d,e,m},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && LtQ[p,-1] && 
  Not[IGtQ[m,0] && RationalQ[a,b,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a+c*x^2,x],
        f=Coeff[PolynomialRemainder[Pq,a+c*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[Pq,a+c*x^2,x],x,1]},
  -(d+e*x)^(m+1)*(a+c*x^2)^(p+1)*(a*(e*f-d*g)+(c*d*f+a*e*g)*x)/(2*a*(p+1)*(c*d^2+a*e^2)) + 
  1/(2*a*(p+1)*(c*d^2+a*e^2))*Int[(d+e*x)^m*(a+c*x^2)^(p+1)*
   ExpandToSum[2*a*(p+1)*(c*d^2+a*e^2)*Q+c*d^2*f*(2*p+3)-a*e*(d*g*m-e*f*(m+2*p+3))+e*(c*d*f+a*e*g)*(m+2*p+4)*x,x],x]] /;
FreeQ[{a,c,d,e,m},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && LtQ[p,-1] && 
  Not[IGtQ[m,0] && RationalQ[a,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

7:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ m<-1

Derivation: Algebraic expansion and quadratic recurrence 3b

Rule 1.2.1.9.7: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ m<-1, 
    let (Subscript[Q, q-1])[x]->PolynomialQuotient[(Subscript[P, q])[x],d+e x,x]and R->PolynomialRemainder[(Subscript[P, q])[x],d+e x,x], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(((d+e x))^(m+1)) (Subscript[Q, q-1])[x] (((a+b x+c (x^2)))^p)dx+R ∫(((d+e x))^m)(((a+b x+c (x^2)))^p)dx  ⟶  

((e R (((d+e x))^(m+1)) (((a+b x+c (x^2)))^(p+1)))/((m+1) (c (d^2)-b d e+a (e^2))))+
(1/((m+1)(c (d^2)-b d e+a (e^2)))) ∫(((d+e x))^(m+1)) (((a+b x+c (x^2)))^p)·
((m+1)(c (d^2)-b d e+a (e^2))(Subscript[Q, q-1])[x]+ c d R (m+1)-b e R (m+p+2)-c e R (m+2 p+3) x)dx

Program code:

Int[(d_.+e_.*x_)^m_*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,d+e*x,x], R=PolynomialRemainder[Pq,d+e*x,x]},
  (e*R*(d+e*x)^(m+1)*(a+b*x+c*x^2)^(p+1))/((m+1)*(c*d^2-b*d*e+a*e^2)) + 
  1/((m+1)*(c*d^2-b*d*e+a*e^2))*Int[(d+e*x)^(m+1)*(a+b*x+c*x^2)^p*
     ExpandToSum[(m+1)*(c*d^2-b*d*e+a*e^2)*Q+c*d*R*(m+1)-b*e*R*(m+p+2)-c*e*R*(m+2*p+3)*x,x],x]] /;
FreeQ[{a,b,c,d,e,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && LtQ[m,-1]

Int[(d_+e_.*x_)^m_*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,d+e*x,x], R=PolynomialRemainder[Pq,d+e*x,x]},
  (e*R*(d+e*x)^(m+1)*(a+c*x^2)^(p+1))/((m+1)*(c*d^2+a*e^2)) + 
  1/((m+1)*(c*d^2+a*e^2))*Int[(d+e*x)^(m+1)*(a+c*x^2)^p*
     ExpandToSum[(m+1)*(c*d^2+a*e^2)*Q+c*d*R*(m+1)-c*e*R*(m+2*p+3)*x,x],x]] /;
FreeQ[{a,c,d,e,p},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && LtQ[m,-1]

8:  ∫(x^m) (Subscript[P, q])[x] (((a+b (x^2)))^p)dx  when ¬(Subscript[P, q])[(x^2)] ∧ m+2∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: (Subscript[P, q])[x]==(∑_(k=0)^(q/2))(Subscript[P, q])[x,2 k] (x^(2 k))+x (∑_(k=0)^((q-1)/2))(Subscript[P, q])[x,2 k+1] (x^(2 k))

Note: This rule transforms (x^m) (Subscript[P, q])[x] into a sum of the form (x^m) (Subscript[Q, r])[(x^2)]+(x^(m+1)) (Subscript[R, s])[(x^2)].

Rule 1.2.1.9.8: If ¬(Subscript[P, q])[(x^2)] ∧ m+2∈(SuperPlus[ℤ]), then

∫(x^m) (Subscript[P, q])[x] (((a+b (x^2)))^p)dx  ⟶  ∫ (x^m) ((∑_(k=0)^(q/2))(Subscript[P, q])[x,2 k] (x^(2 k)))(((a+b (x^2)))^p)dx+∫ (x^(m+1)) ((∑_(k=0)^((q-1)/2))(Subscript[P, q])[x,2 k+1] (x^(2 k)))(((a+b (x^2)))^p)dx

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^2)^p_,x_Symbol] :=
  Module[{q=Expon[Pq,x],k},
  Int[x^m*Sum[Coeff[Pq,x,2*k]*x^(2*k),{k,0,q/2}]*(a+b*x^2)^p,x] + 
  Int[x^(m+1)*Sum[Coeff[Pq,x,2*k+1]*x^(2*k),{k,0,(q-1)/2}]*(a+b*x^2)^p,x]] /;
FreeQ[{a,b,p},x] && PolyQ[Pq,x] && Not[PolyQ[Pq,x^2]] && IGtQ[m,-2] && Not[IntegerQ[2*p]]

9:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ m+q+2 p+1≠0

Derivation: Algebraic expansion and quadratic recurrence 3a with A=d, B=e and m=m-1

Rule 1.2.1.9.9: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0 ∧ m+q+2 p+1≠0, let f->(Subscript[P, q])[x,q], then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  

∫(((d+e x))^m) ((Subscript[P, q])[x]-(f/(e^q)) (((d+e x))^q)) (((a+b x+c (x^2)))^p)dx+(f/(e^q)) ∫(((d+e x))^(m+q)) (((a+b x+c (x^2)))^p)dx  ⟶  

((f (((d+e x))^(m+q-1)) (((a+b x+c (x^2)))^(p+1)))/(c (e^(q-1)) (m+q+2 p+1)))+
(1/(c (e^q) (m+q+2 p+1))) ∫(((d+e x))^m) (((a+b x+c (x^2)))^p) (c (e^q) (m+q+2 p+1) (Subscript[P, q])[x]-c f (m+q+2 p+1) (((d+e x))^q)-
f (((d+e x))^(q-2)) (b d e (p+1)+a (e^2) (m+q-1)-c (d^2) (m+q+2 p+1)-e (2 c d-b e) (m+q+p) x))dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x],f=Coeff[Pq,x,Expon[Pq,x]]},
  f*(d+e*x)^(m+q-1)*(a+b*x+c*x^2)^(p+1)/(c*e^(q-1)*(m+q+2*p+1)) + 
  1/(c*e^q*(m+q+2*p+1))*Int[(d+e*x)^m*(a+b*x+c*x^2)^p*ExpandToSum[c*e^q*(m+q+2*p+1)*Pq-c*f*(m+q+2*p+1)*(d+e*x)^q-
    f*(d+e*x)^(q-2)*(b*d*e*(p+1)+a*e^2*(m+q-1)-c*d^2*(m+q+2*p+1)-e*(2*c*d-b*e)*(m+q+p)*x),x],x] /;
 GtQ[q,1] && NeQ[m+q+2*p+1,0]] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && 
  Not[IGtQ[m,0] && RationalQ[a,b,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x],f=Coeff[Pq,x,Expon[Pq,x]]},
  f*(d+e*x)^(m+q-1)*(a+c*x^2)^(p+1)/(c*e^(q-1)*(m+q+2*p+1)) + 
  1/(c*e^q*(m+q+2*p+1))*Int[(d+e*x)^m*(a+c*x^2)^p*ExpandToSum[c*e^q*(m+q+2*p+1)*Pq-c*f*(m+q+2*p+1)*(d+e*x)^q-
    f*(d+e*x)^(q-2)*(a*e^2*(m+q-1)-c*d^2*(m+q+2*p+1)-2*c*d*e*(m+q+p)*x),x],x] /;
 GtQ[q,1] && NeQ[m+q+2*p+1,0]] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && Not[EqQ[d,0] && True] && 
  Not[IGtQ[m,0] && RationalQ[a,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

10:  ∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  when (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0

Derivation: Algebraic expansion

Basis: (((d+e x))^m) (Subscript[P, q])[x]==(((Subscript[P, q])[x,q] (((d+e x))^(m+q)))/(e^q))+(((((d+e x))^m) ((e^q) (Subscript[P, q])[x]-(Subscript[P, q])[x,q] (((d+e x))^q)))/(e^q))

Rule 1.2.1.9.10: If  (b^2)-4 a c≠0 ∧ c (d^2)-b d e+a (e^2)≠0, then

∫(((d+e x))^m) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx  ⟶  
(((Subscript[P, q])[x,q])/(e^q))∫(((d+e x))^(m+q)) (((a+b x+c (x^2)))^p)dx+(1/(e^q))∫(((d+e x))^m) (((a+b x+c (x^2)))^p)((e^q) (Subscript[P, q])[x]-(Subscript[P, q])[x,q] (((d+e x))^q))dx

Program code:

Int[(d_.+e_.*x_)^m_.*Pq_*(a_.+b_.*x_+c_.*x_^2)^p_.,x_Symbol] :=
  With[{q=Expon[Pq,x]},
  Coeff[Pq,x,q]/e^q*Int[(d+e*x)^(m+q)*(a+b*x+c*x^2)^p,x] + 
  1/e^q*Int[(d+e*x)^m*(a+b*x+c*x^2)^p*ExpandToSum[e^q*Pq-Coeff[Pq,x,q]*(d+e*x)^q,x],x]] /;
FreeQ[{a,b,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && NeQ[c*d^2-b*d*e+a*e^2,0] && 
  Not[IGtQ[m,0] && RationalQ[a,b,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]

Int[(d_+e_.*x_)^m_.*Pq_*(a_+c_.*x_^2)^p_.,x_Symbol] :=
  With[{q=Expon[Pq,x]},
  Coeff[Pq,x,q]/e^q*Int[(d+e*x)^(m+q)*(a+c*x^2)^p,x] + 
  1/e^q*Int[(d+e*x)^m*(a+c*x^2)^p*ExpandToSum[e^q*Pq-Coeff[Pq,x,q]*(d+e*x)^q,x],x]] /;
FreeQ[{a,c,d,e,m,p},x] && PolyQ[Pq,x] && NeQ[c*d^2+a*e^2,0] && 
  Not[IGtQ[m,0] && RationalQ[a,c,d,e] && (IntegerQ[p] || ILtQ[p+1/2,0])]